package com.souche.employment.response;

import lombok.Data;

import java.io.Serializable;

/**
 * 
 * DataResult.java created at 2017年8月19日 下午5:07:02
 * @author Ray [email:rayinhangzhou@hotmail.com]
 * Revision History
 * Date            Programmer                   Notes
 * ----------------------------------------------------------
 **/
@Data
public class DataResult implements Serializable {
	private static final long serialVersionUID = 1632257345228489327L;
	private boolean isSuccess;
	private String message;
	private Object data;
	
	public DataResult() {
		
	}
	
	public static DataResult success(Object tag) {
		DataResult dataResult = new DataResult();
		dataResult.setSuccess(true);
 		dataResult.setData(tag);
		return dataResult;
	}
	
	public static DataResult fail(String message, Object tag) {
		DataResult dataResult = new DataResult();
		dataResult.setSuccess(false);
		dataResult.setMessage(message);
		dataResult.setData(tag);
		return dataResult;
	}
}
